/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 * Description: verbs接口封装
 * Author: lilianlin
 * Create: 2022-02-18
 */

#ifndef HCCL_ADAPTER_VERBS_H
#define HCCL_ADAPTER_VERBS_H

#include <infiniband/verbs.h>
#include "hccl/base.h"

namespace hccl {
HcclResult hrtIbvPostSrqRecv(struct ibv_srq *srq, struct ibv_recv_wr *wr, struct ibv_recv_wr **badWr);
HcclResult hrtIbvPostRecv(struct ibv_qp *qp, struct ibv_recv_wr *wr, struct ibv_recv_wr **badWr);
HcclResult hrtIbvPostSend(struct ibv_qp *qp, struct ibv_send_wr *wr, struct ibv_send_wr **badWr);
HcclResult hrtIbvPollCq(struct ibv_cq *cq, int maxNum, struct ibv_wc *wc, s32& num);
HcclResult hrtIbvReqNotifyCq(struct ibv_cq *cq, int solicitedOnly);
HcclResult hrtIbvGetCqEvent(struct ibv_comp_channel *channel, struct ibv_cq **cq, void **cq_context);
void hrtIbvAckCqEvent(struct ibv_cq *qp, unsigned int nevents);
HcclResult hrtIbvQueryQp(struct ibv_qp *qp);
}
#endif // end HCCL_ADAPTER_VERBS_H